<template>
  <div>
     <h2>{{msg}}</h2>
     <button @click="fn">反转</button>
   </div>
</template>
 
<script>
export default {
  data() {
    return {
      msg:'冯绍峰'
    };
  },

  methods: {
    fn(){
      this.msg=this.msg.split('').reverse('').join('')
    }
  }
};
</script>

<style scoped>
     
</style>